import 'package:wanxiang_app/generated/json/base/json_convert_content.dart';
import 'package:wanxiang_app/bean/registe_entity.dart';

RegisteEntity $RegisteEntityFromJson(Map<String, dynamic> json) {
  final RegisteEntity registeEntity = RegisteEntity();
  final int? code = jsonConvert.convert<int>(json['code']);
  if (code != null) {
    registeEntity.code = code;
  }
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    registeEntity.msg = msg;
  }
  final RegisteData? data = jsonConvert.convert<RegisteData>(json['data']);
  if (data != null) {
    registeEntity.data = data;
  }
  return registeEntity;
}

Map<String, dynamic> $RegisteEntityToJson(RegisteEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['code'] = entity.code;
  data['msg'] = entity.msg;
  data['data'] = entity.data.toJson();
  return data;
}

extension RegisteEntityExtension on RegisteEntity {
  RegisteEntity copyWith({
    int? code,
    String? msg,
    RegisteData? data,
  }) {
    return RegisteEntity()
      ..code = code ?? this.code
      ..msg = msg ?? this.msg
      ..data = data ?? this.data;
  }
}

RegisteData $RegisteDataFromJson(Map<String, dynamic> json) {
  final RegisteData registeData = RegisteData();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    registeData.id = id;
  }
  final int? siteId = jsonConvert.convert<int>(json['site_id']);
  if (siteId != null) {
    registeData.siteId = siteId;
  }
  final int? groupId = jsonConvert.convert<int>(json['group_id']);
  if (groupId != null) {
    registeData.groupId = groupId;
  }
  final String? userName = jsonConvert.convert<String>(json['user_name']);
  if (userName != null) {
    registeData.userName = userName;
  }
  final String? salt = jsonConvert.convert<String>(json['salt']);
  if (salt != null) {
    registeData.salt = salt;
  }
  final String? password = jsonConvert.convert<String>(json['password']);
  if (password != null) {
    registeData.password = password;
  }
  final String? mobile = jsonConvert.convert<String>(json['mobile']);
  if (mobile != null) {
    registeData.mobile = mobile;
  }
  final String? nickname = jsonConvert.convert<String>(json['nickname']);
  if (nickname != null) {
    registeData.nickname = nickname;
  }
  final String? telphone = jsonConvert.convert<String>(json['telphone']);
  if (telphone != null) {
    registeData.telphone = telphone;
  }
  final String? qq = jsonConvert.convert<String>(json['qq']);
  if (qq != null) {
    registeData.qq = qq;
  }
  final String? wechat = jsonConvert.convert<String>(json['wechat']);
  if (wechat != null) {
    registeData.wechat = wechat;
  }
  final int? amount = jsonConvert.convert<int>(json['amount']);
  if (amount != null) {
    registeData.amount = amount;
  }
  final int? isIm = jsonConvert.convert<int>(json['is_im']);
  if (isIm != null) {
    registeData.isIm = isIm;
  }
  final String? regTime = jsonConvert.convert<String>(json['reg_time']);
  if (regTime != null) {
    registeData.regTime = regTime;
  }
  final String? regIp = jsonConvert.convert<String>(json['reg_ip']);
  if (regIp != null) {
    registeData.regIp = regIp;
  }
  final String? userPhoto = jsonConvert.convert<String>(json['user_photo']);
  if (userPhoto != null) {
    registeData.userPhoto = userPhoto;
  }
  final String? idCard = jsonConvert.convert<String>(json['id_card']);
  if (idCard != null) {
    registeData.idCard = idCard;
  }
  final String? realName = jsonConvert.convert<String>(json['real_name']);
  if (realName != null) {
    registeData.realName = realName;
  }
  final int? personalRefresh = jsonConvert.convert<int>(
      json['personal_refresh']);
  if (personalRefresh != null) {
    registeData.personalRefresh = personalRefresh;
  }
  final int? groupRefresh = jsonConvert.convert<int>(json['group_refresh']);
  if (groupRefresh != null) {
    registeData.groupRefresh = groupRefresh;
  }
  final int? oldRefresh = jsonConvert.convert<int>(json['old_refresh']);
  if (oldRefresh != null) {
    registeData.oldRefresh = oldRefresh;
  }
  final int? groupCode = jsonConvert.convert<int>(json['group_code']);
  if (groupCode != null) {
    registeData.groupCode = groupCode;
  }
  final String? invitationCode = jsonConvert.convert<String>(
      json['invitation_code']);
  if (invitationCode != null) {
    registeData.invitationCode = invitationCode;
  }
  final String? invitationUse = jsonConvert.convert<String>(
      json['invitation_use']);
  if (invitationUse != null) {
    registeData.invitationUse = invitationUse;
  }
  final int? invitationNum = jsonConvert.convert<int>(json['invitation_num']);
  if (invitationNum != null) {
    registeData.invitationNum = invitationNum;
  }
  final int? userId = jsonConvert.convert<int>(json['user_id']);
  if (userId != null) {
    registeData.userId = userId;
  }
  return registeData;
}

Map<String, dynamic> $RegisteDataToJson(RegisteData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['site_id'] = entity.siteId;
  data['group_id'] = entity.groupId;
  data['user_name'] = entity.userName;
  data['salt'] = entity.salt;
  data['password'] = entity.password;
  data['mobile'] = entity.mobile;
  data['nickname'] = entity.nickname;
  data['telphone'] = entity.telphone;
  data['qq'] = entity.qq;
  data['wechat'] = entity.wechat;
  data['amount'] = entity.amount;
  data['is_im'] = entity.isIm;
  data['reg_time'] = entity.regTime;
  data['reg_ip'] = entity.regIp;
  data['user_photo'] = entity.userPhoto;
  data['id_card'] = entity.idCard;
  data['real_name'] = entity.realName;
  data['personal_refresh'] = entity.personalRefresh;
  data['group_refresh'] = entity.groupRefresh;
  data['old_refresh'] = entity.oldRefresh;
  data['group_code'] = entity.groupCode;
  data['invitation_code'] = entity.invitationCode;
  data['invitation_use'] = entity.invitationUse;
  data['invitation_num'] = entity.invitationNum;
  data['user_id'] = entity.userId;
  return data;
}

extension RegisteDataExtension on RegisteData {
  RegisteData copyWith({
    int? id,
    int? siteId,
    int? groupId,
    String? userName,
    String? salt,
    String? password,
    String? mobile,
    String? nickname,
    String? telphone,
    String? qq,
    String? wechat,
    int? amount,
    int? isIm,
    String? regTime,
    String? regIp,
    String? userPhoto,
    String? idCard,
    String? realName,
    int? personalRefresh,
    int? groupRefresh,
    int? oldRefresh,
    int? groupCode,
    String? invitationCode,
    String? invitationUse,
    int? invitationNum,
    int? userId,
  }) {
    return RegisteData()
      ..id = id ?? this.id
      ..siteId = siteId ?? this.siteId
      ..groupId = groupId ?? this.groupId
      ..userName = userName ?? this.userName
      ..salt = salt ?? this.salt
      ..password = password ?? this.password
      ..mobile = mobile ?? this.mobile
      ..nickname = nickname ?? this.nickname
      ..telphone = telphone ?? this.telphone
      ..qq = qq ?? this.qq
      ..wechat = wechat ?? this.wechat
      ..amount = amount ?? this.amount
      ..isIm = isIm ?? this.isIm
      ..regTime = regTime ?? this.regTime
      ..regIp = regIp ?? this.regIp
      ..userPhoto = userPhoto ?? this.userPhoto
      ..idCard = idCard ?? this.idCard
      ..realName = realName ?? this.realName
      ..personalRefresh = personalRefresh ?? this.personalRefresh
      ..groupRefresh = groupRefresh ?? this.groupRefresh
      ..oldRefresh = oldRefresh ?? this.oldRefresh
      ..groupCode = groupCode ?? this.groupCode
      ..invitationCode = invitationCode ?? this.invitationCode
      ..invitationUse = invitationUse ?? this.invitationUse
      ..invitationNum = invitationNum ?? this.invitationNum
      ..userId = userId ?? this.userId;
  }
}